Skip to content

Conversation

@n1v0lg
Copy link
Contributor

@n1v0lg n1v0lg commented Oct 8, 2024

This PR default-enables cluster-state role mappings as the first part of the mitigation for a regression in ECK introduced by #107410.

Prior to this PR, cluster-state role mappings were written to cluster-state, but not read from it.

With this PR, cluster-state role mappings will be read and used to assign roles to users, i.e. in user role resolution.

However, they will not be included in the output of the Get role mappings API yet. Exposing them via API is a target for a follow-up fix.

Relates: ES-9628
Supersedes: #113900

@n1v0lg n1v0lg added >bug :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) labels Oct 8, 2024
@n1v0lg n1v0lg self-assigned this Oct 8, 2024
@n1v0lg n1v0lg requested a review from jfreden October 9, 2024 08:14
@n1v0lg n1v0lg changed the title Default enable cluster state role mapping Default enable cluster state role mapper Oct 9, 2024
@jfreden
Copy link
Contributor

jfreden commented Oct 9, 2024

Confirmed on local ECK setup that:

  • A role mapping with the same name in native and operator-defined role mappings is possible
  • The operator-defined role mapping shows up in cluster state
  • That the effective role mapping is the union of operator-defined and native role mappings
  • The GET role mappings api returns only the native mappings
  • A PUT role mapping for a role name that's the same as an operator-defined role mapping works

Base automatically changed from revert-role-mapping-changes to main October 9, 2024 11:46
@n1v0lg n1v0lg marked this pull request as ready for review October 9, 2024 13:13
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@elasticsearchmachine elasticsearchmachine added the Team:Security Meta label for security team label Oct 9, 2024
@n1v0lg n1v0lg added v9.0.0 v8.15.3 v8.16.0 auto-backport Automatically create backport pull requests when merged labels Oct 9, 2024
@elasticsearchmachine
Copy link
Collaborator

Hi @n1v0lg, I've created a changelog YAML for you.

Copy link
Contributor

@jfreden jfreden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@n1v0lg n1v0lg added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) and removed auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Oct 9, 2024
@n1v0lg n1v0lg merged commit 3e06625 into main Oct 9, 2024
20 of 22 checks passed
@n1v0lg n1v0lg deleted the enable-cluster-state-role-mapper branch October 9, 2024 14:54
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

The backport operation could not be completed due to the following error:

An unexpected error occurred when attempting to backport this PR.

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 114337

n1v0lg added a commit that referenced this pull request Oct 9, 2024
This PR default-enables cluster-state role mappings as the first part of the mitigation for a regression in ECK introduced by #107410. 

Prior to this PR, cluster-state role mappings were written to cluster-state, but not read from it. 

With this PR, cluster-state role mappings will be read and used to assign roles to users, i.e. in user role resolution. 

However, they will not be included in the output of the [Get role mappings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html) yet. Exposing them via API is a target for a follow-up fix.

Relates: ES-9628
Supersedes: #113900
n1v0lg added a commit that referenced this pull request Oct 9, 2024
This PR default-enables cluster-state role mappings as the first part of the mitigation for a regression in ECK introduced by #107410. 

Prior to this PR, cluster-state role mappings were written to cluster-state, but not read from it. 

With this PR, cluster-state role mappings will be read and used to assign roles to users, i.e. in user role resolution. 

However, they will not be included in the output of the [Get role mappings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html) yet. Exposing them via API is a target for a follow-up fix.

Relates: ES-9628
Supersedes: #113900
jakelandis pushed a commit that referenced this pull request Oct 9, 2024
This (backport) PR default-enables cluster-state role mappings as the first part of the mitigation for a regression in ECK introduced by #107410. 

Prior to this PR, cluster-state role mappings were written to cluster-state, but not read from it. 

With this PR, cluster-state role mappings will be read and used to assign roles to users, i.e. in user role resolution. 

However, they will not be included in the output of the [Get role mappings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html) yet. Exposing them via API is a target for a follow-up fix.

Relates: ES-9628
Supersedes: #113900
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 10, 2024
This PR default-enables cluster-state role mappings as the first part of the mitigation for a regression in ECK introduced by elastic#107410. 

Prior to this PR, cluster-state role mappings were written to cluster-state, but not read from it. 

With this PR, cluster-state role mappings will be read and used to assign roles to users, i.e. in user role resolution. 

However, they will not be included in the output of the [Get role mappings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html) yet. Exposing them via API is a target for a follow-up fix.

Relates: ES-9628
Supersedes: elastic#113900
n1v0lg added a commit that referenced this pull request Oct 11, 2024
davidkyle pushed a commit to davidkyle/elasticsearch that referenced this pull request Oct 13, 2024
This PR default-enables cluster-state role mappings as the first part of the mitigation for a regression in ECK introduced by elastic#107410. 

Prior to this PR, cluster-state role mappings were written to cluster-state, but not read from it. 

With this PR, cluster-state role mappings will be read and used to assign roles to users, i.e. in user role resolution. 

However, they will not be included in the output of the [Get role mappings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html) yet. Exposing them via API is a target for a follow-up fix.

Relates: ES-9628
Supersedes: elastic#113900
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport pending >bug :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) Team:Security Meta label for security team v8.15.3 v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants